package cn.kgc.javase.collection;

import java.util.Deque;
import java.util.LinkedList;

/**
 * @author 课工场
 * @date 2024/8/15
 * @description
 */
public class LinkListDemo {

    public static void main(String[] args) {

        // LinkedList<Integer> numbers = new LinkedList<>();
        Deque<Integer> numbers = new LinkedList<>();
        numbers.addFirst(1);
        numbers.addFirst(2);
        numbers.addLast(3);
        System.out.println("numbers = " + numbers);


        Integer first = numbers.getFirst();
        System.out.println("first = " + first);
        Integer last = numbers.getLast();
        System.out.println("last = " + last);


        Integer integer = numbers.pollFirst();
        System.out.println("pollFirst() = " + integer);
        Integer integer1 = numbers.pollLast();
        System.out.println("pollLast()= " + integer1);


        System.out.println("numbers = " + numbers);

    }
}
